// plugin/components/noDataTips/noDataTips.js
import app from '../../index'

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    'type': {
      type: String,
      value: '',
      observer: function (newVal, oldVal) {
        this.setData({
          emptyType: newVal
        })
      }
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    emptyType: 0,
    emptyArr: [
      // font:文案，icon：图标名称，imgClass：图片样式类，click：点击事件，status：状态值，type：类型-外部调用组件传入的
      {
        font: '暂无数据',
        icon: 'data',
        imgClass: 'nodata_icon',
        click: null,
        status: '0',
        type: '0'
      },
      {
        font: '周边暂无商户，',
        icon: 'merchant',
        imgClass: 'mer_icon',
        click: 'shopList',
        status: '0',
        type: '1'
      },
      {
        font: '周边暂无商户',
        icon: 'merchant',
        imgClass: 'mer_icon',
        click: null,
        status: '0',
        type: '2'
      },
      {
        font: '暂无订单',
        icon: 'order',
        imgClass: 'order_icon',
        click: null,
        status: '0',
        type: '3'
      },
      {
        font: '暂无代金券',
        icon: 'coupon',
        imgClass: 'order_icon',
        click: null,
        status: '0',
        type: '4'
      },
      {
        font: '暂无收藏',
        icon: 'collect',
        imgClass: 'order_icon',
        click: null,
        status: '0',
        type: '5'
      },
      {
        font: '暂无消息',
        icon: 'message',
        imgClass: 'order_icon',
        click: null,
        status: '0',
        type: '6'
      },
      {
        font: '周边暂无代金卷哦~',
        icon: 'data_2',
        imgClass: 'unclaimed_coupon_icon',
        click: null,
        status: '0',
        type: '7'
      }
    ],

    imgClass: '',
    icon: ''
  },

  pageLifetimes: {
    show: function (params) {
      this.setData({
        emptyType: this.data.type
      })
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    shopList() {
      app.router('../../pages/shopLists/shopLists', 'switchTab')
    },
  }
})